package com.反射;

/**
 * @Author CT
 * @Date 2021/6/14 11:12 下午
 */
public class Student {
    //成员变量：一个私有，一个默认，一个公共
    private String name;
    int age;
    public String address;

    //构造方法：一个私有，一个默认，两个公共

    public Student() {
    }

    public Student(String name, int age, String address) {
        this.name = name;
        this.age = age;
        this.address = address;
    }

    Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    private Student(String name) {
        this.name = name;
    }

    //成员方法：一个私有，四个公共
    private void function() {
        System.out.println("function");
    }

    public void method1() {
        System.out.println("method");
    }

    public void method2(String s) {
        System.out.println("method:" + s);
    }

    public String method3(String s, int i) {
        return s + "," + i;
    }

    public void study() {
        System.out.println("好好学习天天向上");
    }

    @Override
    public String toString() {
        return "Student{" +
                "name=" + name + '\'' +
                ",age=" + age +
                ",address=" + address + '\'' +
                '}';
    }

}
